package org.example.message_queue;

import org.example.message_queue.mqserver.BrokerServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.io.IOException;

@SpringBootApplication
public class MessageQueueApplication {
//      手动获取bean对象
    public static ConfigurableApplicationContext context;


    public static void main(String[] args) throws IOException {
//        run方法的返回值正好是上面的context
        context = SpringApplication.run(MessageQueueApplication.class, args);

        BrokerServer brokerServer = new BrokerServer(9090);
        brokerServer.start();
    }
}
